<template>
  <zero-dialog :showDialog.sync="dialog.open" :width="dialog.width" :title="dialog.title"
               :fullscreen.sync="dialog.fullscreen" :id="dialog.id" :submit="submitForm">
    <div slot="body">
      <vxe-form :ref="form.ref" :data="form.info" :rules="form.rules" title-align="right" title-width="60">
        <vxe-form-item title="名称" field="name" span="24" :item-render="{}">
          <template #default="{ data }">
            <vxe-input max-length="100" v-model="data.name" showWordCount clearable placeholder="请输入名称"/>
          </template>
        </vxe-form-item>
        <vxe-form-item title="备注" field="remarks" span="24" :item-render="{}">
          <template #default="{ data }">
            <vxe-textarea maxlength="255" v-model="data.remarks" showWordCount clearable placeholder="请输入备注"
                          rows="6"/>
          </template>
        </vxe-form-item>
      </vxe-form>
    </div>
  </zero-dialog>
</template>


<script>
import addUpdate from '@/mixins/add-update.js';

export default {
  name: 'addUpdateForm',
  mixins: [addUpdate],
  data() {
    return {
      addUrl: '/sysDept',
      updateUrl: '/sysDept',
      byIdUrl: '/sysDept',
      dialog: {
        id: "addUpdate2DialogId",
        // width: '700px', //定义宽度
      },
      form: {//表单数据
        rules: { //表单验证
          name: [{required: true, message: '请输入名称'}],
          code: [{required: true, message: '请输入编码'}]
        }
      },
    }
  }
}
</script>
